<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
        "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:p="http://primefaces.org/ui"
      xmlns:f="http://java.sun.com/jsf/core" xml:lang="en" lang="en">
<h:head>
    <title>My Facelets Page</title>
    <meta http-equiv="keywords" content="enter,your,keywords,here"/>
    <meta http-equiv="description"
          content="A short description of this page."/>
    <meta http-equiv="content-type" content="text/html; charset=UTF-8"/>

    <!--<link rel="stylesheet" type="text/css" href="styles.css">-->
</h:head>
<h:body>
    <ui:composition template="General.xhtml">
        <ui:define name="title">
            <h:outputText value="讨论区 - 版块列表"/>
        </ui:define>
        <ui:define name="content">
            <p:dataTable value="#{zoneList.zones}" var="zone" style="width:100%">
                <p:column style="width:500px!important;text-align: left;">
                    <f:facet name="header">
                        <h:outputText value="版块"/>
                    </f:facet>
                    <h:outputLink
                            value="#{facesContext.externalContext.requestContextPath}/talk/ThreadList.jspx?id=#{zone.id}"
                            styleClass="header">
                        <h:outputText value="#{zone.name}"></h:outputText>
                    </h:outputLink>
                    <h:outputText value="（#{zone.threadCount}）" styleClass="mark"/><br/>
                    <h:outputText value="版块介绍：" styleClass="tip"/>
                    <h:outputText value="#{zone.description}" styleClass="tip"/><br/>
                    <h:outputText value="版主：" styleClass="mark"/>
                    <ui:repeat value="#{zone.managers}" var="mag" varStatus="row">
                        <h:outputLink
                                value="#{facesContext.externalContext.requestContextPath}/talk/UserCenter.jspx?id=#{mag.id}"
                                styleClass="more">
                            <h:outputText value="#{mag.username}"></h:outputText>
                        </h:outputLink>
                        <h:outputText value="，" rendered="#{!row.last}"></h:outputText>
                    </ui:repeat>
                </p:column>
                <p:column style="width:80px!important;text-align: center;">
                    <f:facet name="header">
                        <h:outputText value="主题数"/>
                    </f:facet>
                    <h:outputText value="#{zone.threadCount}" styleClass="tip"/><br/>
                </p:column>
                <p:column>
                    <f:facet name="header">
                        <h:outputText value="最后发表"/>
                    </f:facet>
                    <h:outputLink
                            value="#{facesContext.externalContext.requestContextPath}/talk/ThreadDetail.jspx?id=#{zone.lastestThread.id}"
                            styleClass="more">
                        <h:outputText value="#{zone.lastestThread.title}"></h:outputText>
                    </h:outputLink><br/>
                    <h:outputText value="#{zone.lastestThread.latestTalk.genTime}" styleClass="tip">
                        <f:convertDateTime pattern="yyyy-MM-dd HH:mm:ss" timeZone="GMT+8"/>
                    </h:outputText>
                    <br/>
                    <h:outputLink
                            value="#{facesContext.externalContext.requestContextPath}/talk/UserCenter.jspx?id=#{zone.lastestThread.latestTalk.genBy.id}"
                            styleClass="more">
                        <h:outputText value="#{zone.lastestThread.latestTalk.genBy.username}"></h:outputText>
                    </h:outputLink>
                </p:column>


            </p:dataTable>
        </ui:define>
    </ui:composition>
</h:body>
</html>
